package com.zueb.stumanage.logic.network

import com.zueb.stumanage.logic.model.LoginData
import com.zueb.stumanage.logic.model.UserLoginResponse
import retrofit2.Retrofit
import retrofit2.converter.gson.GsonConverterFactory
import retrofit2.http.Body
import retrofit2.http.POST

interface MyService {
    @POST("user/login")
    suspend fun userLogin(@Body user: LoginData): UserLoginResponse
    companion object{
        private const val URL = "http://121.89.196.233:8080/stumanage/"
        val api : MyService by lazy {
            val retrofit = Retrofit.Builder()
                .baseUrl(URL)
                .addConverterFactory(GsonConverterFactory.create())
                .build()
            retrofit.create(MyService::class.java)
        }
    }
    }

